import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'normalize.css'
import '@/assets/styles/comm.less'
import lib from '@/components/library/index'
import directives from '@/directives'

/*
Vue.component(组件名,导入的组件)

1:写一个js 
  export default {
    install(Vue,options){
     Vue.component(组件名,导入的组件) 
    }
  }
  export default function(){}
 import xxx from '...'
Vue.use(xxx,optionsxxx)
*/

//

const app = createApp(App)
app.use(lib)
// for (const key in directives) {
//   app.directive(key, directives[key])
// }
Object.keys(directives).forEach(item => {
  app.directive(item, directives[item])
})
// app.directive('test', {
//   mounted (dom, config) {
//     dom.focus()
//     console.log('自定义指令:', dom, config)
//   }
// })
app
  .use(store)
  .use(router)
  .mount('#app')
